Conventionally known is an autofocus mechanism disclosed in Japanese Patent Application Laid-Open No. Hei. 8-220418 (hereafter referred to as Patent Document 1). As shown in FIG. 7, the autofocus mechanism 1 includes an objective lens 14 for collecting a laser beam 16 to irradiate a workpiece 2 to be measured (hereafter referred to as a measurement workpiece) therewith; a beam splitter 20 for splitting light reflected from the measurement workpiece 2 through the objective lens 14; a first pin hole 22 disposed in front of a focal position FP of one split beam of the reflected light; a first photodiode 24 for receiving the reflected beam having passed through the first pin hole 22; a second pin hole 26 disposed behind the focal position FP of the other split beam of the reflected light; a second photodiode 28 for receiving the reflected beam having passed through the second pin hole 26; and a processing unit (not shown) which converts signals output from the first and second photodiodes 24 and 28 into an A_signal voltage and a B_signal voltage so as to determine an A+B_signal voltage V(A+B) and an S_signal voltage VS, which are expressed by following Equations (1) and (2), respectively. Here, the focal position FP of the reflected beam is the position which is obtained when the distance Z between the objective lens 14 and the measurement workpiece 2 is just equal to the focal distance. Note that symbol 12 indicates an image-forming lens.
                              A          +                      B_signal            ⁢                                                  ⁢            voltage            ⁢                                                  ⁢                          V              ⁡                              (                                  A                  +                  B                                )                                                    =                              A_signal            ⁢                                                  ⁢            voltage                    +                      B_signal            ⁢                                                  ⁢            voltage                                              (        1        )                                          S_signal          ⁢                                          ⁢          voltage          ⁢                                          ⁢          VS                =                              (                                          A_signal                ⁢                                                                  ⁢                voltage                            -                              B_signal                ⁢                                                                  ⁢                voltage                                      )                                (                                          A_signal                ⁢                                                                  ⁢                voltage                            +                              B_signal                ⁢                                                                  ⁢                voltage                                      )                                              (        2        )            
The autofocus mechanism 1 employs, as an in-focus position PFJ, the position at which the S_signal voltage VS is equal to a predetermined voltage (an in-focus determination voltage VFJ which is obtained when the distance Z between the measurement workpiece 2 and the objective lens 14 is equal to the focal distance of the objective lens 14). The autofocus mechanism 1 positions the measurement workpiece 2 relative to the objective lens 14 so as to achieve the in-focus position PFJ, thereby providing autofocus control.